package com.itheima.nio.buffer.demo05;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.SocketChannel;

public class NioClientDemo05 {

    public static void main(String[] args) throws IOException {

        SocketChannel socketChannel = SocketChannel.open();
        socketChannel.connect(new InetSocketAddress("127.0.0.1", 7878));
        ByteBuffer byteBuffer = ByteBuffer.wrap("hello".getBytes());
        socketChannel.write(byteBuffer);
        socketChannel.close();
  }

}
